import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Index from "@/views/index/index.vue";
import Demo from "@/views/demo/index.vue";
import About from "@/views/about/index.vue";

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "root",
        component: Layout,
        redirect: { name: "Index" },
        children: [
            {
                path: "index",
                name: "Index",
                component: Index,
                meta: {
                    title: "h5模板",
                    noCache: true,
                    transitions: {
                        priority: 3,
                        enter: "fade",
                        leave: "fade"
                    },
                    props: {
                        id: 1
                    }
                }
            },
            {
                path: "demo",
                name: "Demo",
                component: Demo,
                meta: {
                    title: "Demo头部",
                    noCache: true,
                    transitions: {
                        priority: 2,
                        enter: "slide-left",
                        leave: "slide-left-reverse"
                    },
                    props: {
                        id: 2
                    }
                }
            },
            {
                path: "about",
                name: "About",
                component: About,
                meta: {
                    title: "Demo头部",
                    noCache: true,
                    transitions: {
                        priority: 1,
                        enter: "zoom-in",
                        leave: "zoom-in-reverse"
                    }
                }
            }
        ]
    }
];

export default routes;
